package custom.security.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自定义的验证注解
 * Created by security on 2017/9/23.
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = MyNotBlankValidator.class)    //该注解表用验证规则是哪个具体类
public @interface MyNotBlank {

    String message() default "myNotBlank valid message";    //验证错误时的报错信息

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };
}
